home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / BitsGetter.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-06  |  2.0 KB  |  78 lines

  1. // Bits.h: interface for the CBits class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_BITS_H__15BD6AC5_C161_11D3_94DD_00000100CF13__INCLUDED_)
  6. #define AFX_BITS_H__15BD6AC5_C161_11D3_94DD_00000100CF13__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12.  
  13. struct bits_data {
  14.   /* bit input */
  15.   int Infile;
  16.   unsigned char *Rdbfr;
  17.   unsigned char *Rdptr;
  18.   unsigned char Inbfr[16];
  19.   unsigned int Bfr;
  20.   unsigned char *Rdmax;
  21.   int Incnt;
  22.   int Bitcnt;
  23. };
  24.  
  25. struct PESinfo
  26. {
  27.  
  28. bool  pack_header_parsed; // flag that indicates if the PES was the first in the Pack
  29. unsigned int  pack_bytes; // number of bytes inside the Pack from the byte containing
  30.                           // the last bit of SCRbase field
  31.  
  32. int   streamID;          // streamID of the PES
  33. int      subStreamID;      // subStreamID of the PES
  34.  
  35.                       // Pack info
  36. __int64   SCR;            // System Clock Reference referred to a 27Mhz clock
  37. int    muxrate;        // Pack muxrate in bytes per second
  38.  
  39.                       // PES info
  40. __int64   PTS;            // Presentation Time Stamp referred to a 27Mhz clock
  41. int   payloadSize;    // size in bytes of data contained inside the PES packet
  42. bool  isValidData;     // flag to specify if the data returned is valid or not
  43. };
  44.  
  45.  
  46. class CBitSource {
  47. public:
  48.     //virtual int read(void *buffer, int bytes)=0;
  49.     virtual int ReadPES(unsigned char **buffer, PESinfo *PES)=0;
  50. };
  51.  
  52.  
  53. class CBits
  54. {
  55. public:
  56.     int streamID;
  57.     int subStreamID;
  58.     unsigned int Get_Bits(int N);
  59.     unsigned int Get_Bits1();
  60.     unsigned int Show_Bits(int N);
  61.     int Get_Word();
  62.     int Get_Byte();
  63.     void Initialize_Buffer();
  64.     CBits(CBitSource *source,  int streamID, int subStreamID);
  65.      ~CBits();
  66.     PESinfo PES;
  67.     bool eos;
  68.     void Flush_Buffer(int N);
  69.     void Fill_Buffer();
  70.  
  71. private:
  72.     bits_data *ld;
  73.     CBitSource * src;
  74.     int  audioBufferSize;
  75. };
  76.  
  77. #endif // !defined(AFX_BITS_H__15BD6AC5_C161_11D3_94DD_00000100CF13__INCLUDED_)
  78.